import request from "@/utils/request";

// 查询试卷列表
export function listPaper(query) {
  return request({
    url: "/exam/paper/list",
    method: "get",
    params: query,
  });
}

// 查询试卷详细：有答案
export function getPaper(paperId) {
  return request({
    url: "/exam/paper/" + paperId,
    method: "get",
  });
}

// 查询试卷详细：无答案
export function getPaperNoCurrent(paperId) {
  return request({
    url: "/exam/paper/doexam/" + paperId,
    method: "get",
  });
}

// 
/**
 *   提交试卷
 * @param {*} paperId   试卷id
 * @param {*} data  答案详情
 * @returns 
 */
export function submitPaper (paperId, data) {
  return request({
    url: "/exam/paper/" + paperId,
    method: "post",
    data: data,
  });
}

// 新增试卷
export function addPaper(data) {
  return request({
    url: "/exam/paper",
    method: "post",
    data: data,
  });
}
 
// 删除试卷
export function delPaper(paperId) {
  return request({
    url: "/exam/paper/" + paperId,
    method: "delete",
  });
}

// 修改状态
export function updatePaperStatus(paperId, status) {
  return request({
    url: "/exam/paper/editStatus/" + paperId + "/" + status,
    method: "post",
  });
}
